Skip to content

feat: keep GatewayClass on uninstall via helm.sh/resource-policy when it's the default#1283

Merged
ArnobKumarSaha merged 13 commits into
masterfrom
fix/gatewayclass-finalizer-cleanup
Jun 29, 2026
Merged

feat: keep GatewayClass on uninstall via helm.sh/resource-policy when it's the default#1283
ArnobKumarSaha merged 13 commits into
masterfrom
fix/gatewayclass-finalizer-cleanup

Conversation

@Istiak2019331114

@Istiak2019331114 Istiak2019331114 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Problem
When uninstalling the service-gateway chart, the GatewayClass gets stuck in Terminating because the envoy-gateway controller adds gateway-exists-finalizer.gateway.networking.k8s.io and shuts down before removing it.
Solution
Use helm.sh/resource-policy: keep on the GatewayClass when catalog.appscode.com/is-default-gatewayclass: "true" is set. Helm preserves the resource instead of deleting it, avoiding the Terminating state entirely — no finalizer race condition.
Changes

  • templates/gateway/gwclass.yaml — conditionally add helm.sh/resource-policy: keep when catalog.appscode.com/is-default-gatewayclass is "true"

@Istiak2019331114
Istiak2019331114 marked this pull request as draft June 24, 2026 13:45
@Istiak2019331114
Istiak2019331114 force-pushed the fix/gatewayclass-finalizer-cleanup branch from 50da14f to 35f3b3a Compare June 24, 2026 13:51
@Istiak2019331114 Istiak2019331114 changed the title Add pre-delete hook to strip GatewayClass finalizer on uninstall Add post-delete hook to clean up stuck GatewayClass on uninstall Jun 25, 2026
@Istiak2019331114
Istiak2019331114 marked this pull request as ready for review June 25, 2026 10:52

@ArnobKumarSaha ArnobKumarSaha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api change
helpers.tpl change

Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
@ArnobKumarSaha
ArnobKumarSaha force-pushed the fix/gatewayclass-finalizer-cleanup branch from 5cfe8f3 to 7aaaa79 Compare June 25, 2026 16:10
Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/templates/cleaner/job.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
Comment thread charts/service-gateway/values.yaml Outdated
Istiak2019331114 and others added 9 commits June 26, 2026 18:53
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha force-pushed the fix/gatewayclass-finalizer-cleanup branch from 9ab8e7e to 17a13b0 Compare June 26, 2026 12:53
@ArnobKumarSaha

Copy link
Copy Markdown
Member

Lets just use helm.sh/resource-policy: keep annotation.
For ace only. Any other orgs will cleanup by catalog-manager generally.
Remove all these extra changes.

@ArnobKumarSaha ArnobKumarSaha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup

… it's the default

Signed-off-by: Md. Istiak <mdistiak@appscode.com>
@Istiak2019331114
Istiak2019331114 force-pushed the fix/gatewayclass-finalizer-cleanup branch from f2bf8a3 to 20e0b96 Compare June 29, 2026 06:01
@Istiak2019331114 Istiak2019331114 changed the title Add post-delete hook to clean up stuck GatewayClass on uninstall feat: keep GatewayClass on uninstall via helm.sh/resource-policy when it's the default Jun 29, 2026
Comment thread charts/service-gateway/values.yaml Outdated
@ArnobKumarSaha

Copy link
Copy Markdown
Member

{{- if eq (dig "catalog.appscode.com/is-default-gatewayclass" "" (.Values.gatewayClass.annotations | default dict)) "true" }}
helm.sh/resource-policy: keep
{{- end }}

Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
Signed-off-by: Md. Istiak <mdistiak@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit 823da14 into master Jun 29, 2026
8 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the fix/gatewayclass-finalizer-cleanup branch June 29, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants